package Doudizhu;


import javax.swing.event.TableColumnModelListener;
import java.awt.*;
import java.security.PublicKey;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class pukerGame {


    static ArrayList<String> list = new ArrayList<>();
    static {
        String[] color = {"♥","♠","♦","♣"};
        String[] number = {"A","2","3","4","5","6","7","8","9","10","J","Q","K",};
        for (String c : color) {
            for (String n : number) {
                list.add(c+n);
            }
        }
        list.add("大王");
        list.add("小王");
    }
    public pukerGame(){
        Collections.shuffle(list);

        ArrayList<String> lord = new ArrayList<>();
        ArrayList<String> player1 = new ArrayList<>();
        ArrayList<String> player2 = new ArrayList<>();
        ArrayList<String> player3 = new ArrayList<>();

        for (int i = 0; i < list.size(); i++) {
            if (i<=2){
                lord.add(list.get(i));
            }else if(i%3==0){
                player1.add(list.get(i));
            }else if(i%3==1){
                player2.add(list.get(i));
            }else {
                player3.add(list.get(i));
            }
        }


        lookpuker("han",player1);
        lookpuker("han2",player2);
        lookpuker("han3",player3);
    }
    public void lookpuker(String name,ArrayList<String> list){
        System.out.println(name+":");
        for (String s : list) {
            System.out.print(s + " ");
        }
        System.out.println();
    }
}
